#ifndef MATERIAL_DICTIONARY_H
#define MATERIAL_DICTIONARY_H

#include <string>
#include <utility>
#include <boost/unordered_map.hpp>
#include <OgreColourValue.h>

typedef struct
{
    size_t operator() (const std::pair<uint32_t,uint16_t>& p) const
    {
        size_t hash = 0;
        boost::hash_combine(hash,p.first);
        boost::hash_combine(hash,p.second);
        return hash;
    }
} MaterialPairHash;

class MaterialDictionary
{
public:
    MaterialDictionary();
    void addOrganic(uint32_t index, std::string name);
    void addInorganic(uint32_t index, std::string name);
    void loadColors(std::string path);
    int getNumInorganics();
    int getNumOrganics();
    std::string getName(uint32_t index, uint16_t type);
    Ogre::ColourValue getColour(uint32_t index, uint16_t type);
    Ogre::ColourValue getColour(std::string name);
private:
    boost::unordered_map<std::pair<uint32_t,uint16_t>, std::string, MaterialPairHash> names;
    boost::unordered_map<std::string, Ogre::ColourValue> colors;
    int numOrganics, numInorganics;
};

#endif
